Repository navigation
fix(codegen): reject the #746 Crypto externs on core WASM by name (#822) - #823
Conversation
|
Review these changes at https://app.gitnotebooks.com/hyperpolymath/affinescript/pull/823 |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
d523022 to
51c95b5
Compare
The 6 Crypto externs from #746 compiled to host imports that no core-WASM host supplies, so the module failed at load with a LinkError. A use is now a named compile error that points to --bun-esm. An unused import of one is dropped. Closes #822 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZjyGGiPhiEUxNGPwsr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZjyGGiPhiEUxNGPwsr
51c95b5 to
00f9ae4
Compare
|
… name (#815) (#824) Refs #815 Replaces #820. A push error of mine put main's tip on the #820 branch, so GitHub closed #820 as "merged" with no change. This PR has the same change, rebased on main (after #823). The only new work is the conflict in test/test_e2e.ml: both PRs add tests to `modmut561_tests`, and this PR keeps both sets. ## Summary - `program_free_names` (lib/codegen.ml) now skips a fn's own parameter names. A parameter named `log` under `use Console;` no longer adds a `Console.log` import. - `lower_qualified_value_paths` (lib/resolve.ml) tracks the local binders in scope: let, lambda, match, handler, for and fn params. - When a local captures a qualified `Mod.f` call, resolve gives a clear error: "`Mod.fn` is shadowed by a local `fn` in scope; rename the local". Before, that program linked wrong. ## Gap that remains Issue test 2 (same param plus a qualified call: import kept and links) now gives the clear error. It does not compile yet. Full support needs the qualifier carried through the type checker and the backends (size L). This PR uses "Refs", not "Closes". ## Tests - 3 new e2e tests: param only (no import), qualified call (import kept), capture (error). - `dune runtest` main suite: 662 tests pass (659 on main plus these 3). --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>



Closes #822. Refs #746.
Summary
The 6 Crypto externs from #746 (
sha256,hmac_sha256,base64url_encode,base64url_decode,rsa_sign_pkcs1_sha256,rsa_verify_pkcs1_sha256) compiled on core WASM to host imports that no host supplies. The module then failed at load with aLinkError.gen_imports(lib/codegen.ml) now gives a named error when a program uses one:Crypto.sha256 is not supported on the core-WASM backend; compile with --bun-esm (#822).An unused import of one is dropped, so the program still compiles.
This is the interim that #746 proposes for typed-wasm. The other Crypto externs (
random_string,random_f64,time_ms) are unchanged.Tests
Generated by Claude Code